package org.javaymw.springboot.config;

import org.javaymw.springboot.shiro.freemarker.ShiroTags;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * @Auther: zhaoxinguo
 * @Date: 2018/9/30 17:21
 * @Description:
 */
@Configuration
public class FreeMarkerConfig {

    @Resource
    private freemarker.template.Configuration configuration;

    @PostConstruct
    public void setSharedVariable() {
        try {
            configuration.setSharedVariable("shiro", new ShiroTags());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
